package com.weactivity.config;



import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedisConfig {
    @Bean
    public RedissonClient redissonClient(){
     //配置类
        Config config = new Config();
        //目前是单体应用
        //到后期可以扩展为redis集群
        //就可以添加多个地址
        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
        return Redisson.create(config);

    }

}
